public class lk567 {
    public static void main(String[] args) {
        String s1=new String("ab");
        String s2 = new String("eidbaooo");
        lk567 lk = new lk567();
        System.out.println(lk.checkInclusion(s1,s2));
        
    }
    public boolean checkInclusion(String s1, String s2) {
        int n1 =s1.length();
        int n2 =s2.length(); 
        int j=0;
        for(int i=0;i<n2-n1+1;i++){
            for(int e=0;e<n1;e++){
                if(s1.charAt(e)!=s2.charAt(i+e)){
                    break;
                }
                if(e==n1-1)
                return true;
            }
            for(int e=n1-1;e>=0;e--){
                if(s1.charAt(e)!=s2.charAt(i+j)){
                    break;  
                }
                j++;
                if(e==0)
                return true;
            }
        }
        return false;
    }
}
